package com.aplink.generic.pojo.controlspec.tabhost;

import com.aplink.generic.constant.type.TabhostDisplay;
import com.aplink.generic.pojo.PageCollection;
import com.aplink.generic.pojo.PageItem;
import com.aplink.generic.pojo.controlspec.ControlSpec;
import com.aplink.generic.util.ResourcesHelper;

public class TabHostSpec extends ControlSpec {
    /**
     * 
     */
    private static final long serialVersionUID = 1321801434308276621L;
    private String mBackgroundColor;
    private String mDisplay;
    private PageCollection mPageCollection;
    private int mStartTab = 0;

    public TabHostSpec() {
        this.mPageCollection = new PageCollection();
        this.mDisplay = TabhostDisplay.Title.getValue();
    }

    public TabHostSpec(final int startTab, final String backgroundColor,
            final String display) {
        this.mStartTab = startTab;
        this.mBackgroundColor = backgroundColor;
        this.mDisplay = display;
    }

    public void add(final PageItem tabItem) {
        this.mPageCollection.add(tabItem);
    }

    public String getBackgroundColor() {
        return this.mBackgroundColor;
    }

    public int getBackgroundColorId() {
        return ResourcesHelper.getColorIdByName(this.mBackgroundColor);
    }

    public TabhostDisplay getDisplay() {
        return TabhostDisplay.get(this.mDisplay);
    }

    public PageCollection getPageCollection() {
        return this.mPageCollection;
    }

    public int getStartTab() {
        return this.mStartTab;
    }

    public void setBackgroundColor(final String backgroundColor) {
        this.mBackgroundColor = backgroundColor;
    }

    public void setDisplay(final String display) {
        this.mDisplay = display;
    }

    public void setPageCollection(final PageCollection pageCollection) {
        this.mPageCollection = pageCollection;
    }

    public void setStartTab(final int startTab) {
        this.mStartTab = startTab;
    }

}
